package com.moon.game.command.guest.hunt;

import java.util.ArrayList;

import com.moon.game.command.BaseCmd;
import com.moon.game.command.RequestSession;
import com.moon.game.exception.GException;
import com.moon.game.manager.PlayerMG;
import com.moon.game.message.ObjMessage;
import com.moon.game.resource.model.Monster;
import com.moon.game.service.FightService;
import com.moon.game.vos.PlayerVo;

/**
 * @description 寻怪
 * @author Ranger 作者 E-mail:haozi000005@163.com
 * @version 创建时间：2012-5-8 上午11:30:17
 */
public class FindMonsterCmd extends BaseCmd{
	protected void runOnce(RequestSession req) throws GException {
		switch (req.getStatus()) {
		case STATU_INIT:
			doInit(req);
			break;
		case STATU_CHECK:
			doCheckSelf(req);
			break;
		case STATU_RETURN:
			doResponse(req);
		default:
			break;
		}
	}

	
	@Override
	protected void doResponse(RequestSession req) throws GException {
		ObjMessage resp = req.getClientResponse();
		PlayerVo player = PlayerMG.instance.getPlayer(req.getPlayerId());
		ArrayList<Monster> monsterList = FightService.findMonster(player);
		req.setVO("monster_list", monsterList);
		response(req, resp);
	}

}
